﻿using System;
using System.Collections.Generic;
using Scribble.Repositories;

namespace Scribble.Services
{
    public class PostService : IPostService
    {
        private readonly IPostRepository repository;

        public PostService(IPostRepository repository)
        {
            this.repository = repository;
        }

        public IList<Post> GetPosts()
        {
            return repository.GetPosts();
        }

        public IList<Post> GetPostsByTag(Tag tag)
        {
            return repository.GetPostsByTag(tag);
        }

        public IList<Post> GetPostsByCategory(Category category)
        {
            return repository.GetPostsByCategory(category);
        }

        public Post GetPost(int year, int month, string urlTitle)
        {
            return repository.GetPost(year, month, urlTitle);
        }
    }
}